//
//  APIUtil.h
//  YoucApi
//
//  Created by Liam on 12-10-3.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import "CAReqXauthBindMicroblog.h"

@class GDataXMLElement;
@class YAObjGame;
//@class CARespUserInfo;
//@class CARespUserInfoExt;

#define DECODE(object, type) self.object = [decoder decode##type##ForKey:@#object];

#define ENCODE(object, type) [encoder encode##type:self.object forKey:@#object];

@interface APIUtil : NSObject {

}

//+ (NSString*)getSignature:(NSDictionary*)params;

+ (NSString*)hmac_sha1:(NSData*)data withKey:(NSData*)key;

+ (NSString*)GMTString:(NSDate*)date;
+ (NSDate*)dateFromString:(NSString*)string;
+ (NSString*)stringFromDate:(NSDate*)date;

+ (BOOL)checkCanUseNetwork;

//+ (void)setUserInfo:(CARespUserInfo *)userInfo;
//+ (void)setUserInfoExt:(CARespUserInfoExt *)userInfoExt;
//+ (void)setSessionKey:(NSString *)sessionKey;
//+ (void)setSessionSecret:(NSString *)sessionSecret;
//+ (void)setKeepAlive:(NSInteger)keepAlive;
//+ (CARespUserInfo *)getUserInfo;
//+ (CARespUserInfoExt *)getUserInfoExt;
//+ (NSString *)getSessionKey;
//+ (NSString *)getSessionSecret;
//+ (NSInteger)getKeepAlive;

//+ (NSString*)getClientType;
+ (NSString*)getAppVersion;
+ (NSString *)getNetworkAccessMode;
+ (NSString *)getTelecomsOperator;

+ (NSString*)getAPIServerUrl;

//+ (NSString*)getChildNodeValue:(GDataXMLElement *)node withXPath:(NSString*)xpath;
//+ (GDataXMLElement*)getChildNode:(GDataXMLElement *)node withXPath:(NSString*)xpath;

//+ (NSString*)stringFromMicroblogCode:(MicroblogCode)code;
//+ (MicroblogCode)microblogCodeFromString:(NSString *)sCode;

@end
